package com.icebergteam.warfacewidget.rank.data;

import com.icebergteam.warfacewidget.core.ListViewItem;

import android.os.Parcel;
import android.os.Parcelable;

public class Top100ClansItem extends ListViewItem {

		
	static public final String className = Top100ClansItem.class.getCanonicalName();
	private int pos;
	private String ownerNickname;
	private String clanName;
	private int pos2;
	private int pos3;
	

	public Top100ClansItem() {
		super();
		setPos(1);
		setClanName("clan");
		setOwnerNickname("test");
		setPos2(90);
		setPos3(12);
	}

	public Top100ClansItem(Parcel in) {
		super(in);
		
	}
	
	
	@Override
	public void writeToParcel(Parcel out, int flags) {
		out.writeInt(this.pos);
		out.writeString(this.clanName);
		out.writeString(this.ownerNickname);
		out.writeInt(this.pos2);
		out.writeInt(this.pos3);
	
	}
	@Override
	public void readFromParcel(Parcel in) {
		setPos(in.readInt());
		setClanName(in.readString());
		setOwnerNickname(in.readString());
		setPos2(in.readInt());
		setPos3(in.readInt());
	
		
	}

	public static final Parcelable.Creator<Top100ClansItem> CREATOR = new Parcelable.Creator<Top100ClansItem>() {
		public Top100ClansItem createFromParcel(Parcel in) {
			return new Top100ClansItem(in);
		}

		public Top100ClansItem[] newArray(int size) {
			return new Top100ClansItem[size];
		}
	};
	
	@Override
	public String toString() {
		return String.format("%s", String.format("%s = [%s; %s; %s; %s; %s]", className, getPos(),getClanName(), getOwnerNickname(), getPos2(), getPos3() ));
	}
	
	
	public String getPreviewStr(){
		return String.format("%s_%s", Top100ClansItem.class.getName().replace(Top100ClansItem.class.getPackage().getName() , ""), getClanName());
	}
	/**
	 * @return the pos
	 */
	public int getPos() {
		return pos;
	}

	/**
	 * @param pos the pos to set
	 */
	public void setPos(int pos) {
		this.pos = pos;
	}

	/**
	 * @return the progress
	 */
	public int getPos2() {
		return pos2;
	}

	/**
	 * @param progress the progress to set
	 */
	public void setPos2(int progress) {
		this.pos2 = progress;
	}

	/**
	 * @return the nickname
	 */
	public String getOwnerNickname() {
		return ownerNickname;
	}

	/**
	 * @param nickname the nickname to set
	 */
	public void setOwnerNickname(String nickname) {
		this.ownerNickname = nickname;
	}

	/**
	 * @return the classtime
	 */
	public int getPos3() {
		return pos3;
	}

	/**
	 * @param classtime the classtime to set
	 */
	public void setPos3(int classtime) {
		this.pos3 = classtime;
	}

	/**
	 * @return the clanName
	 */
	public String getClanName() {
		return clanName;
	}

	/**
	 * @param clanName the clanName to set
	 */
	public void setClanName(String clanName) {
		this.clanName = clanName;
	}
}